const Sequelize = require('sequelize')
const { dbName, host, port, user, password,dialect} = require('../config').database
const sequelize = new Sequelize(dbName, user, password, {
    dialect: dialect,
    host,
    port,
    timezone: '+08:00', //设置为北京时区
    logging: true, // 显示sql语句，
    define: {
        timestamps:true,
        paranoid:true,
        createdAt:'createdTime',
        updatedAt:'updatedTime',
        deletedAt:'deletedTime',
        undefined:false
        //配置相关参数
    },
})
sequelize.sync({
    force:false,//生产环境设置为false
})
module.exports = { 
    sequelize 
}